using System;
using Preparation;
using Tester.Forms;
using Tester.GuiActions.Actions.Impl;

namespace Tester.GuiActions.Actions.Impl
{
    public class ShowAlternativeViewAction : BaseAction
    {
        public override bool Visible
        {
            get
            {
                return TesterMultyDocument.Instance != null &&
                       TesterMultyDocument.Instance.Suspended == TesterMultyDocument.SuspendStates.Stopped && 
                       TesterMainForm.Instance.TopControl == EmbededControlTags.TesterList;
            }
        }

        public override void MainAction(object sender, EventArgs e)
        {
            if (Visible)
            {
                AlternativeView form =
                    new AlternativeView(TesterMultyDocument.Instance);
                TesterMainForm.Instance.PushControl(form);
            }
        }
    }
}
